"""
__project__ = 'thc'
__file_name__ = '等待时间'
__author__ = 'thc'
__time__ = '2020/12/23/023 17:03'
__product_name = PyCharm
-*- coding:utf-8 -*-
"""

from selenium import webdriver
import time

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


driver = webdriver.Chrome()
driver.get('https://www.baidu.com')
# driver.implicitly_wait(5)
# try:
#     print(time.ctime())
#     driver.find_element_by_id('kw').send_keys('王者荣耀')
#     driver.find_element_by_id('su').click()
# except Exception as e:
#     print(e)
#
# driver.quit()
# print(time.ctime())

print(time.ctime())
element = WebDriverWait(driver, 5, 0.5).until(EC.visibility_of_element_located((By.ID, 'ww')))
element.send_keys('王者荣耀')
print(time.ctime())

driver.quit()









